home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / Developer Essentials Jul 90 / Programming / MPW Interfaces & Libraries 3.1 / PInterfaces / Windows.p < prev   
Encoding:
Text File  |  1989-10-13  |  7.1 KB  |  282 lines  |  [TEXT/MPS ]

  1. {
  2. Created: Wednesday, August 30, 1989 at 10:51 AM
  3.     Windows.p
  4.     Pascal Interface to the Macintosh Libraries
  5.  
  6.     Copyright Apple Computer, Inc.    1985-1989
  7.     All rights reserved
  8. }
  9.  
  10.  
  11. {$IFC UNDEFINED UsingIncludes}
  12. {$SETC UsingIncludes := 0}
  13. {$ENDC}
  14.  
  15. {$IFC NOT UsingIncludes}
  16.     UNIT Windows;
  17.     INTERFACE
  18. {$ENDC}
  19.  
  20. {$IFC UNDEFINED UsingWindows}
  21. {$SETC UsingWindows := 1}
  22.  
  23. {$I+}
  24. {$SETC WindowsIncludes := UsingIncludes}
  25. {$SETC UsingIncludes := 1}
  26. {$IFC UNDEFINED UsingQuickdraw}
  27. {$I $$Shell(PInterfaces)Quickdraw.p}
  28. {$ENDC}
  29. {$IFC UNDEFINED UsingEvents}
  30. {$I $$Shell(PInterfaces)Events.p}
  31. {$ENDC}
  32. {$IFC UNDEFINED UsingControls}
  33. {$I $$Shell(PInterfaces)Controls.p}
  34. {$ENDC}
  35. {$SETC UsingIncludes := WindowsIncludes}
  36.  
  37. CONST
  38. documentProc = 0;
  39. dBoxProc = 1;
  40. plainDBox = 2;
  41. altDBoxProc = 3;
  42. noGrowDocProc = 4;
  43. zoomDocProc = 8;
  44. zoomNoGrow = 12;
  45. rDocProc = 16;
  46. dialogKind = 2;
  47. userKind = 8;
  48.  
  49. { FindWindow Result Codes }
  50.  
  51. inDesk = 0;
  52. inMenuBar = 1;
  53. inSysWindow = 2;
  54. inContent = 3;
  55. inDrag = 4;
  56. inGrow = 5;
  57. inGoAway = 6;
  58. inZoomIn = 7;
  59. inZoomOut = 8;
  60.  
  61. { window messages }
  62.  
  63. wDraw = 0;
  64. wHit = 1;
  65. wCalcRgns = 2;
  66. wNew = 3;
  67. wDispose = 4;
  68. wGrow = 5;
  69. wDrawGIcon = 6;
  70.  
  71. { defProc hit test codes }
  72.  
  73. wNoHit = 0;
  74. wInContent = 1;
  75. wInDrag = 2;
  76. wInGrow = 3;
  77. wInGoAway = 4;
  78. wInZoomIn = 5;
  79. wInZoomOut = 6;
  80. deskPatID = 16;
  81.  
  82. { Window Part Identifiers which correlate color table entries with window elements }
  83.  
  84. wContentColor = 0;
  85. wFrameColor = 1;
  86. wTextColor = 2;
  87. wHiliteColor = 3;
  88. wTitleBarColor = 4;
  89.  
  90.  
  91. TYPE
  92.  
  93.  
  94. WStateDataPtr = ^WStateData;
  95. WStateDataHandle = ^WStateDataPtr;
  96. WStateData = RECORD
  97.     userState: Rect;            {user state}
  98.     stdState: Rect;             {standard state}
  99.     END;
  100.  
  101. AuxWinPtr = ^AuxWinRec;
  102. AuxWinHandle = ^AuxWinPtr;
  103. AuxWinRec = RECORD
  104.     awNext: AuxWinHandle;        {handle to next AuxWinRec}
  105.     awOwner: WindowPtr;         {ptr to window }
  106.     awCTable: CTabHandle;        {color table for this window}
  107.     dialogCItem: Handle;        {handle to dialog manager structures}
  108.     awFlags: LONGINT;            {reserved for expansion}
  109.     awReserved: CTabHandle;     {reserved for expansion}
  110.     awRefCon: LONGINT;            {user Constant}
  111.     END;
  112.  
  113. WCTabPtr = ^WinCTab;
  114. WCTabHandle = ^WCTabPtr;
  115. WinCTab = RECORD
  116.     wCSeed: LONGINT;            {reserved}
  117.     wCReserved: INTEGER;        {reserved}
  118.     ctSize: INTEGER;            {usually 4 for windows}
  119.     ctTable: ARRAY [0..4] OF ColorSpec;
  120.     END;
  121.  
  122. WindowPeek = ^WindowRecord;
  123. WindowRecord = RECORD
  124.     port: GrafPort;
  125.     windowKind: INTEGER;
  126.     visible: BOOLEAN;
  127.     hilited: BOOLEAN;
  128.     goAwayFlag: BOOLEAN;
  129.     spareFlag: BOOLEAN;
  130.     strucRgn: RgnHandle;
  131.     contRgn: RgnHandle;
  132.     updateRgn: RgnHandle;
  133.     windowDefProc: Handle;
  134.     dataHandle: Handle;
  135.     titleHandle: StringHandle;
  136.     titleWidth: INTEGER;
  137.     controlList: ControlHandle;
  138.     nextWindow: WindowPeek;
  139.     windowPic: PicHandle;
  140.     refCon: LONGINT;
  141.     END;
  142.  
  143. CWindowPeek = ^CWindowRecord;
  144. CWindowRecord = RECORD
  145.     port: CGrafPort;
  146.     windowKind: INTEGER;
  147.     visible: BOOLEAN;
  148.     hilited: BOOLEAN;
  149.     goAwayFlag: BOOLEAN;
  150.     spareFlag: BOOLEAN;
  151.     strucRgn: RgnHandle;
  152.     contRgn: RgnHandle;
  153.     updateRgn: RgnHandle;
  154.     windowDefProc: Handle;
  155.     dataHandle: Handle;
  156.     titleHandle: StringHandle;
  157.     titleWidth: INTEGER;
  158.     controlList: ControlHandle;
  159.     nextWindow: CWindowPeek;
  160.     windowPic: PicHandle;
  161.     refCon: LONGINT;
  162.     END;
  163.  
  164.  
  165.  
  166. PROCEDURE InitWindows;
  167.     INLINE $A912;
  168. PROCEDURE GetWMgrPort(VAR wPort: GrafPtr);
  169.     INLINE $A910;
  170. FUNCTION NewWindow(wStorage: Ptr;boundsRect: Rect;title: Str255;visible: BOOLEAN;
  171.     theProc: INTEGER;behind: WindowPtr;goAwayFlag: BOOLEAN;refCon: LONGINT): WindowPtr;
  172.     INLINE $A913;
  173. FUNCTION GetNewWindow(windowID: INTEGER;wStorage: Ptr;behind: WindowPtr): WindowPtr;
  174.     INLINE $A9BD;
  175. PROCEDURE CloseWindow(theWindow: WindowPtr);
  176.     INLINE $A92D;
  177. PROCEDURE DisposeWindow(theWindow: WindowPtr);
  178.     INLINE $A914;
  179. PROCEDURE GetWTitle(theWindow: WindowPtr;VAR title: Str255);
  180.     INLINE $A919;
  181. PROCEDURE SelectWindow(theWindow: WindowPtr);
  182.     INLINE $A91F;
  183. PROCEDURE HideWindow(theWindow: WindowPtr);
  184.     INLINE $A916;
  185. PROCEDURE ShowWindow(theWindow: WindowPtr);
  186.     INLINE $A915;
  187. PROCEDURE ShowHide(theWindow: WindowPtr;showFlag: BOOLEAN);
  188.     INLINE $A908;
  189. PROCEDURE HiliteWindow(theWindow: WindowPtr;fHilite: BOOLEAN);
  190.     INLINE $A91C;
  191. PROCEDURE BringToFront(theWindow: WindowPtr);
  192.     INLINE $A920;
  193. PROCEDURE SendBehind(theWindow: WindowPtr;behindWindow: WindowPtr);
  194.     INLINE $A921;
  195. FUNCTION FrontWindow: WindowPtr;
  196.     INLINE $A924;
  197. PROCEDURE DrawGrowIcon(theWindow: WindowPtr);
  198.     INLINE $A904;
  199. PROCEDURE MoveWindow(theWindow: WindowPtr;hGlobal: INTEGER;vGlobal: INTEGER;
  200.     front: BOOLEAN);
  201.     INLINE $A91B;
  202. PROCEDURE SizeWindow(theWindow: WindowPtr;w: INTEGER;h: INTEGER;fUpdate: BOOLEAN);
  203.     INLINE $A91D;
  204. PROCEDURE ZoomWindow(theWindow: WindowPtr;partCode: INTEGER;front: BOOLEAN);
  205.     INLINE $A83A;
  206. PROCEDURE InvalRect(badRect: Rect);
  207.     INLINE $A928;
  208. PROCEDURE InvalRgn(badRgn: RgnHandle);
  209.     INLINE $A927;
  210. PROCEDURE ValidRect(goodRect: Rect);
  211.     INLINE $A92A;
  212. PROCEDURE ValidRgn(goodRgn: RgnHandle);
  213.     INLINE $A929;
  214. PROCEDURE BeginUpdate(theWindow: WindowPtr);
  215.     INLINE $A922;
  216. PROCEDURE EndUpdate(theWindow: WindowPtr);
  217.     INLINE $A923;
  218. PROCEDURE SetWRefCon(theWindow: WindowPtr;data: LONGINT);
  219.     INLINE $A918;
  220. FUNCTION GetWRefCon(theWindow: WindowPtr): LONGINT;
  221.     INLINE $A917;
  222. PROCEDURE SetWindowPic(theWindow: WindowPtr;pic: PicHandle);
  223.     INLINE $A92E;
  224. FUNCTION GetWindowPic(theWindow: WindowPtr): PicHandle;
  225.     INLINE $A92F;
  226. FUNCTION CheckUpdate(VAR theEvent: EventRecord): BOOLEAN;
  227.     INLINE $A911;
  228. PROCEDURE ClipAbove(window: WindowPeek);
  229.     INLINE $A90B;
  230. PROCEDURE SaveOld(window: WindowPeek);
  231.     INLINE $A90E;
  232. PROCEDURE DrawNew(window: WindowPeek;update: BOOLEAN);
  233.     INLINE $A90F;
  234. PROCEDURE PaintOne(window: WindowPeek;clobberedRgn: RgnHandle);
  235.     INLINE $A90C;
  236. PROCEDURE PaintBehind(startWindow: WindowPeek;clobberedRgn: RgnHandle);
  237.     INLINE $A90D;
  238. PROCEDURE CalcVis(window: WindowPeek);
  239.     INLINE $A909;
  240. PROCEDURE CalcVisBehind(startWindow: WindowPeek;clobberedRgn: RgnHandle);
  241.     INLINE $A90A;
  242. FUNCTION GrowWindow(theWindow: WindowPtr;startPt: Point;bBox: Rect): LONGINT;
  243.     INLINE $A92B;
  244. FUNCTION FindWindow(thePoint: Point;VAR theWindow: WindowPtr): INTEGER;
  245.     INLINE $A92C;
  246. FUNCTION PinRect(theRect: Rect;thePt: Point): LONGINT;
  247.     INLINE $A94E;
  248. FUNCTION DragGrayRgn(theRgn: RgnHandle;startPt: Point;boundsRect: Rect;
  249.     slopRect: Rect;axis: INTEGER;actionProc: ProcPtr): LONGINT;
  250.     INLINE $A905;
  251. FUNCTION TrackBox(theWindow: WindowPtr;thePt: Point;partCode: INTEGER): BOOLEAN;
  252.     INLINE $A83B;
  253. PROCEDURE GetCWMgrPort(VAR wMgrCPort: CGrafPtr);
  254.     INLINE $AA48;
  255. PROCEDURE SetWinColor(theWindow: WindowPtr;newColorTable: WCTabHandle);
  256.     INLINE $AA41;
  257. FUNCTION GetAuxWin(theWindow: WindowPtr;VAR awHndl: AuxWinHandle): BOOLEAN;
  258.     INLINE $AA42;
  259. PROCEDURE SetDeskCPat(deskPixPat: PixPatHandle);
  260.     INLINE $AA47;
  261. FUNCTION NewCWindow(wStorage: Ptr;boundsRect: Rect;title: Str255;visible: BOOLEAN;
  262.     procID: INTEGER;behind: WindowPtr;goAwayFlag: BOOLEAN;refCon: LONGINT): WindowPtr;
  263.     INLINE $AA45;
  264. FUNCTION GetNewCWindow(windowID: INTEGER;wStorage: Ptr;behind: WindowPtr): WindowPtr;
  265.     INLINE $AA46;
  266. FUNCTION GetWVariant(theWindow: WindowPtr): INTEGER;
  267.     INLINE $A80A;
  268. FUNCTION GetGrayRgn: RgnHandle;
  269. PROCEDURE SetWTitle(theWindow: WindowPtr;title: Str255);
  270.     INLINE $A91A;
  271. FUNCTION TrackGoAway(theWindow: WindowPtr;thePt: Point): BOOLEAN;
  272.     INLINE $A91E;
  273. PROCEDURE DragWindow(theWindow: WindowPtr;startPt: Point;boundsRect: Rect);
  274.     INLINE $A925;
  275.  
  276. {$ENDC}    { UsingWindows }
  277.  
  278. {$IFC NOT UsingIncludes}
  279.     END.
  280. {$ENDC}
  281.  
  282.